package architect.design.patterns.creation.simplefactory;

/**
 * 工厂类
 *
 * @author guanxin
 * @date 2018/5/4 11:28
 */

public class ComputerFactory implements IComputerFactory {

    public IComputer createComputer(ComputerType computerType) {
        switch (computerType) {
            case Computer:
                return new Computer();
            case DeskTop:
                return new DeskTop();
            case LapTop:
                return new LapTop();
            default:
                return new Computer();
        }
    }
}
